package com.dmjj.cadcommon.result;

/**
 * @author 王丽凯
 * @Description: TODO
 * @Title: ResultEnum
 * @ProjectName dmjj-parent
 * @date 2018/12/24
 */
public enum ResultEnum {

    /**
     * @Description: 成功返回信息
     * @author 王丽凯
     * @date 2019/1/12
     */
    SUCCESS("ok",200),
    SUCCESS1("调用接口成功，openid不存在",10011),
    SUCCESS2("调用接口成功，code违法",10012),
    SUCCESSSCAN("已成功扫码等待确认",1010),
    FAIL("失败",1002),
    EXCEPTION("服务器异常",1003),
    FAILPARAM("参数错误",1004),
    CALLBACKOK("已回访",1005),
    EVALUATEOK("已评价",1006),
    BALANCEOK("已结算",1007),
    CODEINVALID("二维码已失效，请重新获取",1008),
    CODEWAIT("等待扫描",1009),
    CANCELLOGIN("取消登录成功",1011),
    NOTMYSELF("非本人操作",1012),
    FAILTOLOGIN("未登录",1100);




    private String msg;
    private int code;

    private ResultEnum(String msg, int code){
        this.msg = msg;
        this.code = code;
    }

    private static String getMsg(int code){
        for (ResultEnum resultEnum: ResultEnum.values()){
            if (resultEnum.getCode()==code){
                return resultEnum.getMsg();
            }
        }
        return null;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
